/usr/sbin/dnscrypt-proxy 2>dnscrypt-proxy.log &
i=0
timeout=20
while [ $i -lt $timeout ]
do
    grep "dnscrypt-proxy is ready" dnscrypt-proxy.log > /dev/null
    if [ $? -eq 0 ]
    then
        break
    fi
    let i+=1
    echo -e "*\c"
    sleep 1
done

echo ""

if [ $i -eq $timeout ]
then
    echo "Warning! DNSCrypt-proxy haven't ready with in ${timeout} seconds!"
else
    echo "DNSCrypt-proxy is ready!"
fi

echo "nameserver 127.0.0.1" > /etc/resolv.conf

/bin/bash